package com.hjb.toolbardemo.fragment;

import android.view.View;
import android.widget.ListView;

import com.hjb.toolbardemo.R;
import com.hjb.toolbardemo.adapter.HomeAdapter;
import com.hjb.toolbardemo.base.BaseFragment;
import com.hjb.toolbardemo.widget.SwipeRefreshLayout;
import com.hjb.toolbardemo.widget.SwipeRefreshLayoutDirection;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 作者 : hjb
 * 时间 : 2016/4/25.
 */
public class HomeTabFragment extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener {
    @InjectView(R.id.listView)
    ListView mListView;
    @InjectView(R.id.refresh)
    SwipeRefreshLayout mRefresh;

    @Override
    public View initRootView() {
        rootView = mInflater.inflate(R.layout.frag_home, null);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @Override
    public void setViews() {
        HomeAdapter adapter = new HomeAdapter(getActivity(), null);
        mListView.setAdapter(adapter);
        mRefresh.setDirection(SwipeRefreshLayoutDirection.BOTH);
        mRefresh.setOnRefreshListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void onRefresh(SwipeRefreshLayoutDirection direction) {

    }
}
